﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace C_
{
    class A
    {
        private A()
        {
            Console.WriteLine($"hhhhhhhh: " + $"{Thread.CurrentThread.ManagedThreadId}");

        }

        private static object _lock = new object();
        static public A GetA()
        {
            if (_sInst == null)
            {
                lock (_lock)
                {
                    if (_sInst == null)
                        _sInst = new A();
                }
            }

            return _sInst;
        }

        static private A _sInst;

        public void Print()
        {
            Console.WriteLine("hhhhhhhhhhh");
        }
    }

    
}
